<script>
    function del_info(reply_id, id_num) {
        id_num = id_num.toString();
        var AjaxUrl = "/post_j/delete/" + reply_id;
        $.getJSON(AjaxUrl, function (Json) {
            $("#del_info_" + id_num).html('');

        });
    }
</script>
<script>
    function update_valid(reply_id, id_num) {
        id_num = id_num.toString();
        var AjaxUrl = "/post_j/update_valid/" + reply_id;
        $.getJSON(AjaxUrl, function (Json) {
            $("#del_info_" + id_num).html('');

        });
    }
</script>
<div class="row">
    <div class="col-md-10">
        <div class="panel panel-black">
            <div class="panel-heading"><span class="glyphicon glyphicon-envelope"></span> {{ kwd['router'] }} 信息列表</div>
            <div class="panel-body">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>标题</th>
                        <th>分类</th>
                        <th>时间</th>
                        <th colspan="2">操作</th>
                    </tr>
                    </thead>
                    {% set ii = 0 %}
                    {% for x in view %}
                    <tr id="del_info_{{ ii }}">

                        <td width="50%"><a href="/{{kwd['router']}}/{{ x.uid }}" title="{{x.title}}" target="_blank">{{x.title}}</a></td>
                        <td width="30%">
                            {% if kwd['with_catalog'] %}
                            <span class="post_cat">{% module post_catalogs(x.uid,kwd['kind']) %}</span>
                            {% end %}
                        </td>


                        <td width="10%">
                            {% if kwd['with_date'] %}
                            <em class="date">
                                {{ datetime.datetime.fromtimestamp(x.time_update).strftime('%Y-%m-%d') }}
                            </em>
                            {% end %}
                        </td>
                        <td width="5%">

                            <a href="/{{kwd['router']}}/_edit/{{ x.uid }}" target="_blank"><span class="glyphicon glyphicon-pencil"></span> 修改</a>

                        </td>
                        <td width="5%">
                            <a class="trash" onclick="update_valid('{{ x.uid }}', {{ ii }} );">
                                <span class="glyphicon glyphicon-trash"></span> 删除
                            </a>
                        </td>
                    </tr>
                    {% set ii = ii + 1 %}
                    {% end %}
                </table>
            </div>
        </div>
    </div>
</div>
